<include file="public@head_top"/>
</head>
<body class="bgeee">
<include file="public@head"/>
<include file="public@sidebar_head"/>

<div class="newsW">

    <div class="discussBlock st-block">
      <div class="discusscate">
      	<span class="<if condition="$configinfo['columnid'] eq 141">btn btn-success<else>btn btn-light</if>"><a href="{:cmf_url('portal/list/index',array('id'=>141))}" onclick='delCookie("topic_cookie");$("#topickeyword").val("");' title="全部话题" class="<if condition="$configinfo['columnid'] eq 141">st-colf</if>">全部</a></span>
        <portal:subcategories key="key" categoryId="$configinfo.moduleid">
        	<span class="<if condition="$configinfo['columnid'] eq $vo['id']">btn btn-success<else>btn btn-light</if>">
                <a href="{:cmf_url('portal/list/index',array('id'=>$vo.id))}" title="{$vo.name}" class="<if condition="$configinfo['columnid'] eq $vo['id']">st-colf</if>">
                      <i class="fa fa-caret-right"></i> {$vo.name}
                </a>
            </span>
        </portal:subcategories>
      </div>
      <php>
        $raw = $_SERVER['REQUEST_URI'];
        $code = strstr($raw, 'scuss');
        $codex = substr($code,6,-8);
        $urlx = urldecode($codex);

        $state = $urlx;
        if ($state != 'issue' && $state != 'reply'){
            $state = 'issue';
        }
      </php>
      <form id="myform" method="post" action="{:cmf_url('portal/list/index',array('id'=>141,'discuss'=>$state))}" style="margin:0;padding:0;">
        <section id="topic_search" class="form-group">
          <label for="topickeyword"><i class="fa fa-search" aria-hidden="true"></i></label>
          <input class="form-control" type="text" id="topickeyword" name="keyword" placeholder="^_^输入关键词快捷“查询”" autocomplete="off" spellcheck="false" autocorrect="off" tabindex="1" value="{$keyword}" style=""/>
        </section>
        <input type="submit" class="btn btn-primary hide" value="" style="display:none;"/>
      </form>
      <div class="card discusslist">
        <div class="card-header">
          <ul class="nav nav-pills card-header-pills">
            <li class="nav-item">
                <a class="nav-link <if condition="$state eq 'issue'">active</if>" href="{:cmf_url('portal/list/index',array('id'=>141,'discuss'=>'issue'))}"><i class="fa fa-list"></i> 最新发布</a>
              </li>
              <li class="nav-item">
                <a class="nav-link <if condition="$state eq 'reply'">active</if>" href="{:cmf_url('portal/list/index',array('id'=>141,'discuss'=>'reply'))}"><i class="fa fa-comments"></i> 最新回复</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="/user/profile/center.html" target="_blank"><i class="fa fa-plus-circle"></i> 发表话题</a>
              </li>
          </ul>
        </div>
        <div class="card-body">
          <div id="list_content_tips"> 
          
            <php>                
                $where=[
                'post.create_time'=>['egt',0],
                'post.post_title'=>['like',"%$keyword%"]
                ];
                if ($state == 'reply'){
                    $order = 'post.is_top DESC,post.update_time DESC';
                }else{
                    $order = 'post.is_top DESC,post.published_time DESC';
                }
                $page=[
                    'list_rows'=>15,
                    'next'=>$configlang['Next_page'],
                    'prev'=>$configlang['Previous_page']
                ];
            </php>
            <portal:articles item="vo" where="$where" expwhere="$expwhere" order="$order" page="$page" relation="categories" categoryIds="$category.id" returnVarName="articles_data">
                             
            <!-- 话题按筛选分类列表显示 -->
            <ul id="list_content" class="list-boxes list-unstyled" style="margin-top:0;margin-bottom:0;">
              <li style="border;none;">
                <div class="pull-left list-pic">
               		<a class="pull-left img-wraper" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$vo['category_id']))}" style="margin-right:10px;">
                    	<img class="media-object avatar" src="{:cmf_url('user/public/avatar',array('id'=>$vo['user_id']));}">
                    </a>
                </div>
                <h2>
                    <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$vo['category_id']))}" title="{$vo.post_title}">
                    	<if condition="$vo['is_top'] eq 1"><i class="fa fa-arrow-up" title="置顶" style="color:#ff8800;font-weight:100; position:relative; top:-1px; font-size:18px;"></i></if>
                        {$vo.post_title}
                    </a>
                </h2>
                <div class="listdesc">
                  <notempty name="vo.taglist">
                    <p>
                        {$configlang['label']}:&nbsp&nbsp
                        <foreach name="vo.taglist" item="tag">
                         <a class="taglist"href="{:cmf_url('portal/Tag/index',array('id'=>$configinfo.moduleid,'tid'=>$tag.tag_id))}" title="{$tag.name}">{$tag.name}</a> | 
                        </foreach>
                     </p>
                     </notempty>
                  <div class="pull-left">
                    <div class="list-actions">
                    	<notempty name="configindex['columnlist'][$vo['category_id']]['name']">
                          <span class="cate">{$configindex['columnlist'][$vo['category_id']]['name']}</span>
                        <else/>
                          <span class="all">ALL</span>
                        </notempty>
                        <span>{$vo.user.user_nickname|default='匿名用户'}</span>
                        <a href="javascript:;">
                        	<i class="fa fa-eye"></i> <span>{$vo.post_hits}</span>
                        </a> 
                        <a href="{:url('portal/Article/doLike',array('id'=>$vo['id']))}"
                                       class="js-count-btn"><i class="fa fa-thumbs-up"></i> <span class="count">{$vo.post_like}</span></a>
                        <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$vo['category_id']))}">
                        	<i class="fa fa-commenting-o"></i> <span>{$vo.comment_count}</span>
                        </a>
                    </div>
                  </div>
                  <div class="pull-right dateinfo">
                  	<if condition="$state eq 'reply'">{:date('Y-m-d H:i:s',$vo.update_time)}<else/>{:date('Y-m-d H:i:s',$vo.published_time)}</if>
                  </div>
                </div>
              </li>
            </ul>
            </portal:articles>
            
          </div>
        </div>
      </div>
      
      <!--分页-->
      <div class="show-pages">
            <div class="show-pagination">
                <page/>
            </div>
        </div>
        
    </div>

</div>

<script type="text/javascript">
    $(function(){

        var list_state = $('#list_content');
        if(list_state.length>0){
            return false;
        }else{
            $('#list_content_tips').html('<div style="margin:0 auto;padding:20px 0;text-align:center;color:#666;">暂没有找到相关内容！</div>');
            return false;
        }

    });
</script>

<include file="public@sidebar_foot"/>
<include file="public@footer"/>
</body>    
</html>